
let res = {
    "/user": ["get", async (ctx) => {

        ctx.render('hello.html', {
            title: "这里是用户界面"
        });
    }],
    "/user/login": ["get", async (ctx) => {
        ctx.render('login.html', {
            title: "用户登录界面"
        });
    }],
    "/user/doLogin": ["post", async (ctx) => {
        let username = ctx.request.body.username;
        let password = ctx.request.body.password;

        if (username == "admin" && password == "123456") {
            ctx.redirect("/user");
        } else {
            ctx.body = "账号或密码错误"
        }
    }],
    "/user/detali": ["get", async (ctx) => {
        ctx.body = "用户详情"
    }],
    "/user/delete": ["delete", async (ctx) => {
        ctx.body = "删除用户"
    }],
    "/user/put": ["put", async (ctx) => {
        ctx.body = "修改用户"
    }],
    "/user/add": ["post", async (ctx) => {
        ctx.body = "添加用户"
    }],
}

module.exports = res;